package com.weds.edjk.web;

import com.weds.edjk.service.FileMonitorService;
import com.weds.edjk.vo.DepTreeVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author wangjianqiang
 * @Description 监控相关页面
 * @Date 2020/06/15
 * @version
 */
@Controller
@RequestMapping("monitor")
public class MonitorController {

    @Autowired
    FileMonitorService fileMonitorService;


    @RequestMapping("index")
    public  String index(Model model){
        return "index";
    }

    /**
     * 人员监控
     * @return
     */
    @RequestMapping("user")
    public  String attend(){
        return "user";
    }
    /**
     * 车辆监控
     * @return
     */
    @RequestMapping("car")
    public  String car(){
        return "car";
    }

    /**
     * 总监控
     * @return
     */
    @RequestMapping("all")
    public  String userAndCar(){
        return "userAndCar";
    }

    /**
     * 档案管理
     * @return
     */
    @RequestMapping("file")
    public String fileManage(@Param("depId") String depId, Model model) {
        List<DepTreeVo> depTree = fileMonitorService.getDepTree();
        model.addAttribute("depTree", depTree);
        model.addAttribute("depId", depId);
        return "file";
    }

}
